package com.pms.mapper;

import com.github.pagehelper.Page;
import com.pms.dto.ComplaintPageQueryDTO;
import com.pms.entity.Complaint;
import com.pms.vo.ComplaintPageQueryVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface ComplaintMapper {
    /**
     * 新增投诉
     * @param complaint
     */
    @Insert("insert into complaint(community_id, content, owner_id, create_time) " +
            "values (#{communityId},#{content},#{ownerId},#{createTime})")
    void save(Complaint complaint);

    /**
     * 投诉分页查询
     * @param complaintPageQueryDTO
     * @return
     */
    Page<ComplaintPageQueryVO> page(ComplaintPageQueryDTO complaintPageQueryDTO);

    /**
     * 批量删除
     * @param id
     */
    @Delete("delete from complaint where id=#{id}")
    void delete(Integer id);
}
